/*
 * @Description:
 * @version:
 * @Author: lxs
 * @Date: 2022-09-13 14:16:59
 */
import { getApi } from "@/utils/http";

/**获取用户信息*/
export async function getRandomImage(random: string) {
  return await getApi(`/m/sys/randomImage/${random}`);
}

/**
 * @description: 获取所有地区
 * @return {*}
 */
export async function getAllArea() {
  return await getApi('/client/common/getAll');
}

/**
 * @description: 获取开放地区
 * @return {*}
 */
export async function getOpenArea() {
  return await getApi('/client/common/getOpenCity');
}

/**
 * @description: 获取城市信息
 * @param {any} data
 * @return {*}
 */
export async function getCityInfoByLatAndLon(data: any) {
  return await getApi('/client/common/reverseGeocoding', data);
}

/**
 * @description: 根据城市名称获取地铁线路
 * @param {any} data
 * @return {*}
 */
export async function getSubwaysTreeByCityName(data: any) {
  return await getApi('/client/common/querySubwaysTreeByCityCode', data);
}

/**
 * @description: 根据code查询省市区
 * @param {any} data
 * @return {*}
 */
export async function getAreaByCode(data: any) {
  return await getApi('/client/common/queryAreaByParentCode', data);
}

/**
 * @description: 根据字典code查询字典
 * @param {string} dicCode
 * @return {*}
 */
export async function getDictValue(dictCode: string) {
  return await getApi('/client/houseSearch/queryDictValueByDictCode', {dictCode});
}

/**
 * @description: 百度地图圆形区域检索
 * @param {any} data
 * @return {*}
 */
export async function circularAreaRetrieval(data: any) {
  return await getApi(`/client/common/circularAreaRetrieval`, data);
}

/**
 * @description: 获取城市对应的价格范围
 * @param {} code
 * @return {*}
 */
export async function getRangeByCityFetch(code: string|number) {
  return await getApi(`/client/common/getOpenCityRange?cityCode=${code}`);
}
